home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / sparkl29.zip / MENU.BAT < prev    next >
DOS Batch File  |  1991-06-15  |  2KB  |  57 lines

  1. echo off
  2. cls
  3. echo            Here's an example of how to create a menu using Sparkle.
  4. rem
  5. rem  ---- First display a window (option #6):
  6. rem       first some color, then the window (with shadow -- "-2").
  7. rem
  8. sparkle 6 4 1 20 80 32 32 /
  9. sparkle 6 5 10 18 71 79 -2 /... Main Menu ...
  10. rem
  11. rem  ---- 2nd, print the 4 menu options (plus Quit)
  12. rem
  13. sparkle 5 8  31   112 /── This is option 1 ──
  14. sparkle 5 10 31   112 /── This is option 2 ──
  15. sparkle 5 12 31   112 /── This is option 3 ──
  16. sparkle 5 14 31   112 /── This is option 4 ──
  17. sparkle 5 16 31   112 /── Quit             ──
  18. rem
  19. rem  ---- Now we tell Sparkle to turn this into a VERTICAL Bar menu (direction = 1)
  20. rem       Option # = 2.  Screen coordinates 7, 17 (top left) to 16, 65 (bottom right).
  21. rem       Note:  we're making our "bar" much wider than necessary just for effect.
  22. rem
  23. sparkle 2 7 17 16 65 1
  24. rem
  25. rem  ---- add your own lines here to test Errorlevel
  26. rem
  27. If Errorlevel 88 Goto Error
  28. If Errorlevel 27 Goto EscPressed
  29. If Errorlevel  5 Goto 5thOption
  30. If Errorlevel  4 Goto 4thOption
  31. If Errorlevel  3 Goto 3rdOption
  32. If Errorlevel  2 Goto 2ndOption
  33. If Errorlevel  1 Goto 1stOption
  34. Goto End
  35. :Error
  36. echo An error must have occurred.  Possibly someone changed this and I can't find
  37. echo or process the menu.  Sorry.  Check the batch file.
  38. goto end
  39. :EscPressed
  40. echo You pressed Escape.
  41. goto end
  42. :1stOption
  43. echo You selected the 1st option
  44. goto end
  45. :2ndOption
  46. echo You selected the 2nd option
  47. goto end
  48. :3rdOption
  49. echo You selected the 3rd option
  50. goto end
  51. :4thOption
  52. echo You selected the 4th option
  53. goto end
  54. :5thOption
  55. echo You selected the 5th option -- Quit
  56. :End
  57.